using System;
using Commons.Geom;
using Commons.Models.Definitions;
using Commons.Events;

public delegate void BasicEventHandler(object sender, BasicEventArgs e);
public delegate void CancellableEventHandler(object sender, CancellableEventArgs e);
public delegate void ButtonEventHandler(object sender, ButtonEventArgs e);
public delegate void CheckButtonEventHandler(object sender, CheckButtonEventArgs e);
public delegate void PopupEventHandler(object sender,BasicEventArgs e);
public delegate void FloatEventHandler(object sender, FloatEventArgs e);

public class BasicEventArgs : EventArgs
{

	public static new readonly BasicEventArgs Empty = new BasicEventArgs();

	public int Count { get; protected set; }

	public virtual string Name
	{
		get
		{
			return GetType().Name;
		}
	}

	public BasicEventArgs()
		: this(1)
	{
	}

	public BasicEventArgs(int count)
	{
		this.Count = count;
	}
}

public class CancellableEventArgs : BasicEventArgs
{
	public bool Cancelled { get; protected set; }

	public CancellableEventArgs() : base()
	{

	}

	public void Cancel()
	{
		Cancelled = true;
	}
}

public class FloatEventArgs : EventArgs
{
	public float floatValue;
	public FloatEventArgs(float v)
	{
		floatValue = v;
	}
}

public class ButtonEventArgs : EventArgs
{
	protected object _target;
	public object target
	{
		get { return _target; }
	}

	public ButtonEventArgs(object target)
	{
		this._target = target;
	}
}
public class CheckButtonEventArgs : EventArgs
{
	protected object _target;
	public object target
	{
		get { return _target; }
	}
	protected bool _isChecked;
	public bool isChecked 
	{
		get { return _isChecked; } 
	}
	
	public CheckButtonEventArgs(object target, bool isChecked)
	{
		this._target = target;
		this._isChecked	= isChecked;
	}
}
